package com.youlai.boot.system.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

@Getter
@AllArgsConstructor
public enum OrderTypeEnum {

    CD_JG(1L, "触动机构", "cdjgOrderHandle"),
    CD_JG_C(2L, "触动机构+C", "cdjgCOrderHandle"),
    XCP_XIAN(3L, "新产品 线", "xianOrderHandle"),
    XCP(4L, "新产品", "xcpOrderHandle"),
    PJ(5L, "配件", "pjOrderHandle"),
    OTHER(6L, "永乐/利居", "otherOrderHandle"),
    ;

    private final Long type;
    private final String name;
    private final String beanName;

    // 新增一个根据类型获取beanName的方法
    public static OrderTypeEnum getByType(Long type) {
        for (OrderTypeEnum value : values()) {
            if (value.type.equals(type)) {
                return value;
            }
        }
        return null;
    }

}